package com.twu.biblioteca;

public class BibliotecaApp {

    public static void main(String[] args) {
        MainMenu mainMenu = new MainMenu();
        UserManagement userManagement = new UserManagement();
        System.out.println(mainMenu.getWelcomeMessage());
        while (true) {
            if (userManagement.getCurrentUser().isToggleOn()) {
                printMenuOptionsAfterLogin(mainMenu);
            } else {
                printMenuOptionsBeforeLogin(mainMenu);
            }
            mainMenu.handleUserInput();
        }
    }

    private static void printMenuOptionsAfterLogin(MainMenu mainMenu) {
        for (String menuOption : mainMenu.getMenuOptionsAfterLogin()) {
            System.out.println(menuOption);
        }
    }

    private static void printMenuOptionsBeforeLogin(MainMenu mainMenu) {
        for (String menuOption : mainMenu.getMenuOptionsBeforeLogin()) {
            System.out.println(menuOption);
        }
    }
}
